option(WITH_DISTCC "Distribute build with distcc." OFF)
if(WITH_DISTCC)
  find_program (DISTCC_EXECUTABLE distcc)
  if(DISTCC_EXECUTABLE)
    message(STATUS "Building with distcc: ${DISTCC_EXECUTABLE}")
    list(APPEND CMAKE_C_COMPILER_LAUNCHER "${DISTCC_EXECUTABLE}")
    list(APPEND CMAKE_CXX_COMPILER_LAUNCHER "${DISTCC_EXECUTABLE}")
  else(DISTCC_EXECUTABLE)
    message(FATAL_ERROR "Can't find distcc. Is it installed?")
  endif(DISTCC_EXECUTABLE)
endif(WITH_DISTCC)
